//
//  Test1ViewController.m
//  Floating Window
//
//  Created by 吴浪 on 15/8/24.
//  Copyright (c) 2015年 浪遥. All rights reserved.
//

#import "Test1ViewController.h"
#import "MYColor.h"
#import "Test2ViewController.h"


@interface Test1ViewController ()
@property (nonatomic,retain)UITextField *tf;
@end

@implementation Test1ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"Test1";
    self.view.backgroundColor = MYRandomColor;
    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"继续" style:UIBarButtonItemStylePlain target:self action:@selector(forWardClick)];
    
    self.tf = [[UITextField alloc]initWithFrame:CGRectMake(100, 200, 200,50)];
    self.tf.backgroundColor = [UIColor whiteColor];
    self.tf.tag =100;
    
    [self.view addSubview:self.tf];
    
    
    UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(50, 100, 80, 80)];
    [btn setTitle:@"测试按钮" forState:UIControlStateNormal];
    btn.titleLabel.font = [UIFont systemFontOfSize:15];
    [btn setTintColor:UIControlStateNormal];
    [self.view addSubview:btn];
    [btn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
    
    // Do any additional setup after loading the view.
}

-(void)btnClick{

   self.tf.text = @"我是测试按钮";


}
- (void)forWardClick {
    Test2ViewController *test2VC = [[Test2ViewController alloc] init];
    [self.navigationController pushViewController:test2VC animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
